load('classpath:ext/dubbo.js');

var dubbo = new Dubbo("zookeeper://127.0.0.1:2181");

System.out.println("hello world.");

var helloWordService = dubbo.service("com.lamb.learn.test.api.HelloWorldService");

function sayHello(name, msg) {
    var parameterTypes = ["java.lang.String", "java.lang.String"];
    var argsList = [name, msg];
    return helloWordService.invoke("sayHello", parameterTypes, argsList);
}

for(var i = 0; i < 10; i ++) {
    console.info("result == " + sayHello("lamb", "hello too! = " + i));
}
exit(0);
